# encoding=utf8
import sys
reload(sys)
sys.setdefaultencoding('utf8')
from ..MessageAnalysis import*

class JT_0805:
    result = []
    s=""
    def LogicAisle(self, protocolStr, header):
        count = 0
        s=protocolStr[count:count + 4]
        header.append("应答流水号:" + s +"\n")
        count = count+4
        s=protocolStr[count:count + 2]
        if s=="01":
            header.append("结果：失败" + "\n")
            count = count + 2
        elif s=="02":
            header.append("结果：通道不支持" + "\n")
            count = count + 2
        elif s=="00":
            header.append("结果：成功" + "\n")
            count = count + 2
            s = protocolStr[count:count + 4]
            n =int(s,16)
            header.append("多媒体ID个数:" + str(n) + "\n")
            count = count + 4
            header.append("多媒体列表:"+"\n")
            for i in range(n):
                s = protocolStr[count:count + 8]
                header.append(s + "\n")
                count = count + 8
        self.result = header   
